<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/manager/easyui/themes/default/easyui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/manager/easyui/themes/icon.css}">
    <script type="text/javascript" th:src="@{/manager/easyui/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/manager/easyui/jquery.easyui.min.js}"></script>
    <script type="text/javascript">
            $(function(){
             //初始化easyuidialog控件
              $("#dg").dialog({
                 title:"我是dialog",
                 width:700,
                 height:500,
                 closed:true,
                 href:"",
                 cache:false,
                 iconCls:"icon-save",
                 modal:true,
                 buttons:[
                     {
                         text:"提交",
                         iconCls:"icon-ok",
                         handler:function(){
                             $("#combox").combobox("setValue",1);
                             $("#inp").textbox("setValue",1000)
                             alert( $("#inp").textbox("getValue"));
                         }
                     },
                     {
                         text:"关闭",
                         handler:function(){
                             //关闭
                             $("#dg").dialog("close");
                             console.log($("#dg").dialog("options"));
                         }
                     }
                 ]
             });


              $("#combox").combobox({
                  url:"/manager/test/findSelect",
                  method:"post",
                  valueField:"id",
                  textField:"username",
                  onLoadSuccess:function(){
                     /* let data = $("#combox").combobox("getData");
                      let json =[];
                      json[0]={
                          id:-1,
                          username:"请选择"
                      };
                      for(let i=0;i<data.length;i++){
                          json[i+1]=data[i];
                      }
                      $("#combox").combobox("loadData",json);*/
                  }

              });


         });

         function dgopen(){
             //打开
             $("#dg").dialog("open");
         }
    </script>
</head>
<body>
 <button type="button" onclick="dgopen()">open</button>
   <div id="dg">
      <select id="combox" style="width: 200px;"></select>
       <input class="easyui-textbox" id="inp"/>
   </div>
</body>
</html>